
#ifndef _PERCEPTRON_H_
#define _PERCEPTRON_H_

class Perceptron
{
public:

	Perceptron(int data_dim, double max_iteractions = 1000, double learning_rate = 0.7);
	~Perceptron();

	double RunNetwork(double *data);
	void Train(double **input, double *output, int num_samples);

protected:

	void _alloc_stuff();
	void _dealloc_stuff();
	void _randomize_weights();
	int _convergence_test();
	void _update_weights(double delta, double *data);
	double _train_step(double **input, double *output, int num_samples);

	int _data_dim;
	double _learning_rate;
	double _max_iteractions;
	
	double _bias;
	double *_weights;
};

#endif